<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<c:set var="reportTitle" value="SPC基础数据报表" />

<%@ include file="/common/report_head.jsp" %>
<%@ include file="/condition/sartTime_YMD_input.html"%>
<%@ include file="/condition/endTime_YMD_input.html"%>
<%@ include file="/condition/fab_sumo_must.html"%>
<%@ include file="/condition/toolg_sumo.html"%>
<%@ include file="/condition/toolType_radio.html"%>
<%@ include file="/condition/tool_sumo.html"%>
<%@ include file="/condition/collectType_sumo.html"%>
<%@ include file="/condition/reportType_radio.html"%>
<%@ include file="/condition/controlChartGrp_sumo.html"%>
<%@ include file="/condition/controlChart_sumo.html"%>

<%@ include file="/common/report_middle.jsp" %>
<div class="col-md-12" style="height: 820px;">
    <div id="pqGrid"></div>
</div>
<%@include file="/common/report_end.jsp" %>


<script>
    $(document).ready(function () {
        $("title").text("SPC基础数据报表");
        $("label:contains('管制图组:')").addClass("keyCss");
        $("label:contains('管制图:')").addClass("keyCss");


        $('#query_btn').click(function (){
            if($("#controlChartGrpSumo").val() === null || $("#controlChartGrpSumo").val() === '' || $("#controlChartSumo").val() === null || $("#controlChartSumo").val() === ''){
                showErrorDialog("0000002", "管制图组和管制图为必选项"); return false;
            }
            initGridAndChart();
            ajax('/jn-report/report/spc_report.do' ,loadConditionMapData(), true, ajax_successful);

            function ajax_successful(outTrxObj) {
                if(outTrxObj.gridData.length < 1) { showMessengerDialog("数据查询为空"); return false; }

                // Grid表格动态列
                var colM = [
                    {halign:"center",align:'center', dataIndx: 'toolg_desc',	         title: '设备组',    width: 220,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'tool_desc',	             title: '设备名称',    width: 170,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'col_typ_fk',	         title: '收集类型',    width: 75,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'rpt_typ_fk',	         title: '上报类别',    width: 75,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'rpt_b_date',	         title: '上报开始时间',    width: 130,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'rpt_e_date',	         title: '上报结束时间',    width: 130,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'grp_no_fk',		         title: '管控组号码',    width: 110,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_no_fk',	         title: '管制图号码',    width: 110,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'data_group_fk',	         title: '量测名称',    width: 150,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'grp_name_fk',	         title: '管制图组名称',    width: 210,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_name_fk',	         title: '管制图名称',    width: 200,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_typ_fk',	         title: '管制图类型',    width: 110,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_usl',		         title: '管制图_USL',    width: 110,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_ucl',		         title: '管制图_UCL',    width: 110,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_target',	         title: '管制图_Target',    width: 130,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_mean',	         title: '管制图_Mean',    width: 230,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_lcl',		         title: '管制图_LCL',    width: 110,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_lsl',		         title: '管制图_LSL',    width: 110,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_sigma_cpk',	     title: '管制图_Sigma_CPK',    width: 170,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_sigma_raw',	     title: '管制图_Sigma_RAW',    width: 170,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'chart_sigma_ppk',	     title: '管制图_Sigma_PPK',    width: 170,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_total_count',	     title: '总计算点数',    width: 100,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_oos_count',	     title: 'OOS数量',    width: 90,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_oos_rate',	         title: 'OOS占比',    width: 90,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_ooc_count',	     title: 'OOC数量',    width: 90,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_ooc_rate',	         title: 'OOC占比',    width: 90,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_oosc_count',	     title: 'OOSC数量',    width: 90,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_oosc_rate',	     title: 'OOSC占比',    width: 90,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_ca',		         title: 'CA',    width: 230,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_cp',		         title: 'CP',    width: 230,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_cpk',		         title: 'CPK',    width: 230,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_pp',		         title: 'PP',    width: 40,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_ppk',		         title: 'PPK',    width: 210,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_grade',	         title: '等级',    width: 40,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'calc_b_proc_timestamp',  title: '制程时间',    width: 230,   editable: false, sortable: true},
                ];
                _pqUtil.f.setColModel($("#pqGrid"), colM);
                _pqUtil.f.seTitle($("#pqGrid"), outTrxObj.gridTitle);
                _pqUtil.f.loadPqGridData($("#pqGrid"), outTrxObj.gridData);
            };
        });
    });
</script>
